package com.yanqu.road.entity.beautyescort;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.date.DateHelper;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_c_escort_report")
public class EscortReport extends DataObject {

    @FieldTypeAnnotation(update = true, desc = "玩家id")
    private long userId;

    @FieldTypeAnnotation(desc = "区服id")
    private long serverId;

    @FieldTypeAnnotation(update = true, desc = "走镖id,按玩家递增")
    private long dartId;

    @FieldTypeAnnotation(update = true, desc = "走镖类型")
    private int dartType;

    @FieldTypeAnnotation(select = true, desc = "周id")
    private int weekId;

    @FieldTypeAnnotation(desc = "劫持者（废弃）")
    private List<Long> enemy = new ArrayList<>();

    @FieldTypeAnnotation(desc = "奖励")
    private String reward = "";

    @FieldTypeAnnotation(desc = "事件")
    private int eventId;

    @FieldTypeAnnotation(desc = "被劫次数")
    private int robbedTimes;

    @FieldTypeAnnotation(desc = "镖车开始时间")
    private int startTime;

    @FieldTypeAnnotation(desc = "最新被劫时间")
    private int latestRobTime;

    @FieldTypeAnnotation(desc = "删除标识")
    private boolean del;

    /**
     * 被反击人当key
     */
    @FieldTypeAnnotation(desc = "反击")
    private Map<Long, EscortBeatBack> beatBack = new ConcurrentHashMap<>();;

    /**
     * 攻击缓存，谁在攻击
     */
    private Map<Long, Long> beatingMap = new ConcurrentHashMap<>();


    @FieldTypeAnnotation(desc = "劫镖者信息")
    private List<EnemyInfo> enemyInfoList = new ArrayList<>();

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public long getServerId() {
        return serverId;
    }

    public void setServerId(long serverId) {
        if(this.serverId != serverId) {
            this.serverId = serverId;
            setUpdateOption();
        }
    }

    public long getDartId() {
        return dartId;
    }

    public void setDartId(long dartId) {
        if(this.dartId != dartId) {
            this.dartId = dartId;
            setUpdateOption();
        }
    }

    public int getDartType() {
        return dartType;
    }

    public void setDartType(int dartType) {
        if(this.dartType != dartType) {
            this.dartType = dartType;
            setUpdateOption();
        }
    }

    public int getWeekId() {
        return weekId;
    }

    public void setWeekId(int weekId) {
        if(this.weekId != weekId) {
            this.weekId = weekId;
            setUpdateOption();
        }
    }

    public List<Long> getEnemy() {
        return enemy;
    }

    public void setEnemy(List<Long> enemy) {
        if(this.enemy != enemy) {
            this.enemy = enemy;
            setUpdateOption();
        }
    }

    public void addEnemy(long enemyId){
        this.enemy.add(enemyId);
        setUpdateOption();
    }

    public String getReward() {
        return reward;
    }

    public void setReward(String reward) {
        if(!Objects.equals(this.reward, reward)) {
            this.reward = reward;
            setUpdateOption();
        }
    }

    public int getEventId() {
        return eventId;
    }

    public void setEventId(int eventId) {
        if(this.eventId != eventId) {
            this.eventId = eventId;
            setUpdateOption();
        }
    }

    public int getRobbedTimes() {
        return robbedTimes;
    }

    public void setRobbedTimes(int robbedTimes) {
        if(this.robbedTimes != robbedTimes) {
            this.robbedTimes = robbedTimes;
            setUpdateOption();
        }
    }

    public int getStartTime() {
        return startTime;
    }

    public void setStartTime(int startTime) {
        if(this.startTime != startTime) {
            this.startTime = startTime;
            setUpdateOption();
        }
    }

    public int getLatestRobTime() {
        return latestRobTime;
    }

    public void setLatestRobTime(int latestRobTime) {
        if(this.latestRobTime != latestRobTime) {
            this.latestRobTime = latestRobTime;
            setUpdateOption();
        }
    }

    public boolean isDel() {
        return del;
    }

    public void setDel(boolean del) {
        if(this.del != del) {
            this.del = del;
            setUpdateOption();
        }
    }

    public Map<Long, EscortBeatBack> getBeatBack() {
        return beatBack;
    }

    public void setBeatBack(Map<Long, EscortBeatBack> beatBack) {
        this.beatBack = beatBack;
        setUpdateOption();
    }

    public Map<Long, Long> getBeatingMap() {
        return beatingMap;
    }

    public void setBeatingMap(Map<Long, Long> beatingMap) {
        this.beatingMap = beatingMap;
    }

    public List<EnemyInfo> getEnemyInfoList() {
        return enemyInfoList;
    }

    public void setEnemyInfoList(List<EnemyInfo> enemyInfoList) {
        if(this.enemyInfoList != enemyInfoList) {
            this.enemyInfoList = enemyInfoList;
            setUpdateOption();
        }
    }

    public void addEnemyInfo(EnemyInfo enemyInfo){
        this.enemyInfoList.add(enemyInfo);
        setUpdateOption();
    }

}
